
<?php $mainbar = 'main';
 $pageId="page-product";
?>
@extends('ios.pageIndex')

@section("title")
    <title>{{$product->name}}</title>
@show

@section('page-content')
<div class="content-padded">
	
	<div class="m-product">
		
    	<h3 class="brand">{{$product->brand or $product->enname}}</h3>
    	<h4 class="ename">{{$product->enname}}</h4>
    	<div class="name">{{$product->name}}</div>
    	
    	<div class="price">
    	@if($product->discount_price > 0)
    	<span class="line-through">¥{{number_format($product->price,2)}}</span>
    	<span class="text-red">¥{{number_format($product->discount_price,2)}}</span>
    	@else
    	<span>¥{{number_format($product->price,2)}}</span>
    	@endif
        </div>
    	<div class="img-wrap gutter">
    		@foreach($product->images as $img)
			<img alt="" src="{{Images::url($img->image)}}">
			@endforeach
    	</div>
    	
    	<!-- 规格尺寸 -->
    	
    	<form id="product-form">
    	<input type="hidden" name="enname" value="{{$product->enname}}"/>
    	<input type="hidden" name="id" value="{{$product->id}}"/>
    	<input type="hidden" name="name" value="{{$product->name}}"/>
    	<input type="hidden" name="image" value="{{$product->image}}">
    	<input type="hidden" name="price" value="{{$product->discount_price > 0 ? $product->discount_price : $product->price}}"/>
    	<input type="hidden" name="postage_mode" value="{{$product->postage_mode}}"/>
    	
    	<div class="select-wrap row">
    		@if (count($product->sizes))
    		<div class="col-50">
	    		<select name="size_id" class="cs-select cs-skin-elastic">
		    		<option value="0">请选择</option>
		    			@foreach($product->sizes as $size)
		    			<option value="{{$size->id}}">{{$size->size}}</option>
		    			@endforeach
		    	</select>
    		</div>
	    	@endif
	    	@if (count($product->colors))
	    	<div class="col-50">
	    		<select name="color_id" class="cs-select cs-skin-elastic">
	    			<option value="0">请选择</option>
	    			@foreach($product->colors as $color)
	    			<option value="{{$color->id}}">{{$color->color}}</option>
	    			@endforeach
	    		</select>
	    	</div>
	    	@endif
    	</div>
    	</form>
    	
    	@if ($product->quantity > 0 && !$product->deleted_at)
    	<a href="#" class="button button-big m-button title" id="add-product">加入购物车</a>
    	<a href="#" class="button button-big title" style="margin-top: 1rem;" id="add-favorite">加入收藏夹</a>
    	@else
    	<a href="#" class="button button-big m-button disable title">SOLD OUT</a>
    	<a href="#" class="button button-big title" style="margin-top: 1rem;" id="add-favorite">加入收藏夹</a>
    	@endif
    	<div class="list-block  no-padded custom-accordion">
		  <ul>
		   @if(!empty($product->ext))
		    <li class="accordion-item accordion-item-expanded">
		      <a href="#" class="item-content">
		      	<div class="item-inner">
		          <div class="accordion-item-toggle">
				      <i class="icon-plus">+</i>
				      <i class="icon-minus">-</i>
				      <b class="title">商品描述</b>
			      </div>
		        </div>
		      </a>
		      <div class="accordion-item-content">
		          {{$product->ext->content}}
		      </div>
		    </li>
		    <li class="accordion-item">
		      <a href="#" class="item-content">
		      	<div class="item-inner">
		          <div class="accordion-item-toggle">
				      <i class="icon-plus">+</i>
				      <i class="icon-minus">-</i>
				      <b class="title">成分及保养</b>
			      </div>
		        </div>
		      </a>
		      <div class="accordion-item-content">
		        {{$product->ext->maintain}}
		      </div>
		    </li>
		    <li class="accordion-item">
		      <a href="#" class="item-content">
		      	<div class="item-inner">
		          <div class="accordion-item-toggle">
				      <i class="icon-plus">+</i>
				      <i class="icon-minus">-</i>
				      <b class="title">寄送与退货</b>
			      </div>
		        </div>
		      </a>
		      <div class="accordion-item-content">
		          {{$product->ext->returns}}
		      </div>
		    </li>
		    <!--<li></li> 处理边框问题，最后一个li的item-inner:after没有生效 -->
		    @endif
		    
		  </ul>
		</div>
		
		<div>
			<div class="like-title"><b class="title">您可能会喜欢</b></div>
			 <div class="row row-wrap">
	          	@foreach($recommends as $p)
				  <div class="col-50">
				  	 <a href="{{URL::to('product',$p->id)}}" title="{{$p->name}}" class="external">
				  	 <div class="img-wrap">
				  	  <img src="{{Images::url($p->image,400,480)}}" alt="{{$p->name}}"/>
				  	 </div>
				     <span class="like-item-brand">{{$p->brand}}</span>
				     <div class="like-item-name">{{$p->name}}</div>
				    </a>
				  </div>
				@endforeach
	          </div>
	          <div class="clear"></div>
		</div>
		<div class="text-center">
			<div class="like-title" style="border-top:1px solid #dddddd;margin-top: 9px;"><b class="title">客服中心</b></div>
			<p style="margin: 0.2rem 0;"><a href="tel:400 710 8990" class="external">400 710 8990</a></p>
			<p style="margin-top: 0.5rem;">周一至周六  9:00 - 18:00</p>
			
			<a href="tel:4007108990" class="button button-big external" style="font-size: 16px;">致电我们</a>
		</div>
	</div>

</div>
@stop
